<template>
  <div style="width: 100%; height: 100%">
    <div class="bg">
      <div class="text1">
        <b>双线质量管控体</b>
      </div>
      <div class="text2">
        <b>力求每件产品 、每个细节都尽善尽美</b>
      </div>
      <div class="text3">
        <b
          >够专业
          <div style="margin-top: 28px"></div>
          才放心</b
        >
      </div>
      <div class="text7">
        <b>ORDER聚造</b>
      </div>
      <div class="text8">
        <b>ORDER聚造</b>   
      </div>
      <div class="box1">
        <div class="touminBox1"></div>
        <div class="touminBox2"></div>
      </div>
      <div class="box2">
        <div class="text4">
          All Rights Reserved &copy; 2021 版权所有 &nbsp; &nbsp; &nbsp; ｜
          &nbsp; 粤ICP备18069755号
        </div>
      </div>
      <div class="box3">
        <div class="loginBox">
          <div class="text5">欢迎使用</div>
          <div class="text6"><b>系统登陆</b></div>
          <el-form
            :model="ruleForm"
            :hide-required-asterisk="true"
            :rules="rules"
            ref="ruleForm"
            label-width="100px"
            class="demo-ruleForm"
          >
            <div class="inputDiv">
              <el-form-item label="用户名" prop="userName">
                <el-input autosize v-model="ruleForm.userName">
                  <img
                    slot="prefix"
                    class="inputIcon"
                    src="../assets/userName.png"
                  />
                </el-input>
              </el-form-item>
            </div>
            <div class="inputDiv">
              <el-form-item label="密  码" prop="passWord">
                <el-input autosize type="password" v-model="ruleForm.passWord">
                  <img
                    slot="prefix"
                    class="inputIcon"
                    src="../assets/password.png"
                  />
                </el-input>
              </el-form-item>
            </div>
          </el-form>
          <div class="submit" @click="submitForm">登录</div>
        </div>
      </div>
    </div>
  </div>
</template>


<script>
import md5 from 'js-md5';
console.log(md5('111111'))
// import axios from "axios";
// console.log(axios);

export default {
  name: "App",
  components: {
    //HelloWorld
  },
  data() {
    return {
      ruleForm: {
        userName: "",
        passWord: "",
      },
      rules: {
        userName: [
          { required: true, message: "请输入用户名", trigger: "blur" },
        ],
        passWord: [
          { required: true, message: "请输入密码", trigger: "blur" }
          ],
      },
    };
  },
  methods: {
    submitForm() {
      this.$refs.ruleForm.validate((valid) => {
        if (valid) {
           this.$http({
             url:'/login',
             method:'POST',
             data:{
               userName:this.ruleForm.userName,
               passWord:md5(this.ruleForm.passWord),
               platform:'Web'
             }
           }).then(res => {
             if(!res.errorMsg){
               localStorage.setItem('token',res.token)
               localStorage.setItem('user',JSON.stringify(res))
               this.$router.push('/index')
             }
           })
        }
      });
    }
  },
  created() {},
  mounted() {},
};
</script>

<style>
/* html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: Microsoft YaHei UI, Microsoft YaHei UI-Bold;
} */
/* #app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
} */
/* .app1{
  background:url('/image/test.png');
  height: 300px;
} */
/* .bg{
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url(../assets/loginBackground.png);
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    display: flex;
} */
.bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  min-width: 1000px;
  zoom: 1;
  background-color: #fff;
  background: url(../assets/loginBackground.png) no-repeat;
  background-size: cover;
  -webkit-background-size: cover;
  -o-background-size: cover;
  background-position: center 0;
  display: flex;
  overflow: none;
}
.box1 {
  width: 33%;
  height: 100%;
  z-index: 10;
}
.box2 {
  width: 397px;
  height: 100%;
  z-index: 10;
}
.box3 {
  width: 37%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
}
.touminBox1 {
  margin-top: 198px;
  margin-left: 83px;
  width: 115px;
  height: 158px;
  background: #e1f2f9;
  opacity: 0.3;
}
.touminBox2 {
  margin-bottom: 235px;
  margin-left: 154px;
  width: 132px;
  height: 161px;
  background: #e1f2f9;
  opacity: 0.3;
}
.text1 {
  position: absolute;
  margin-top: 208px;
  margin-left: 130px;
  width: 22px;
  line-height: 18px;
  font-size: 16px;
  font-family: MicrosoftYaHeiUI-Bold-, MicrosoftYaHeiUI-Bold;
  font-weight: normal;
  color: #fefefe;
  writing-mode: lr-tb;
}
.text2 {
  position: absolute;
  margin-top: 208px;
  margin-left: 168px;
  width: 20px;
  line-height: 14px;
  font-size: 16px;
  font-family: MicrosoftYaHeiUI-Bold-, MicrosoftYaHeiUI-Bold;
  font-weight: normal;
  color: #ffffff;
  writing-mode: tb-rl;
}
.text3 {
  position: absolute;
  margin-top: 255px;
  margin-left: 220px;
  width: 34px;
  line-height: 28px;
  font-size: 27px;
  font-family: MicrosoftYaHeiUI-Bold-, MicrosoftYaHeiUI-Bold;
  font-weight: normal;
  color: #6bb9da;
  writing-mode: lr-tb;
}
.text4 {
  margin-top: 575px;
  width: 397px;
  height: 200px;
  font-size: 13px;
  font-family: MicrosoftYaHeiUI-Bold-, MicrosoftYaHeiUI-Bold;
  font-weight: normal;
  color: #565656;
  white-space: nowrap;
}
.loginBox {
  position: relative;
  width: 351px;
  height: 351px;
  background: #efeff0;
  border-radius: 20px;
  opacity: 0.9;
  z-index: 20;
}
.text5 {
  margin-top: 22px;
  margin-left: 31px;
  width: 51px;
  height: 16px;
  font-size: 13px;
  font-family: MicrosoftYaHeiUI-, MicrosoftYaHeiUI;
  font-weight: normal;
  color: #96a3b0;
  white-space: nowrap;
}
.text6 {
  margin-top: 6px;
  margin-left: 31px;
  width: 325px;
  height: 53px;
  font-size: 26px;
  font-family: MicrosoftYaHeiUI-Bold-, MicrosoftYaHeiUI-Bold;
  font-weight: normal;
  color: #4e4e4e;
}
.formText {
  margin-left: 29px;
  width: 37px;
  height: 16px;
  font-size: 13px;
  font-family: MicrosoftYaHeiUI-, MicrosoftYaHeiUI;
  font-weight: normal;
  color: #737474;
}
.inputDiv {
  margin-right: 20px;
}
.inputIcon {
  margin-left: 10px;
  width: 12px;
  height: 14px;
}

/* .user {
  width: 12px;
  height: 14px;
  position: absolute;
  left: 25%;
  bottom: 59%;
  background-image: url(../assets/userName.png);
  background-repeat: no-repeat;
  background-size: cover;
}
.psd {
  width: 12px;
  height: 14px;
  position: absolute;
  left: 25%;
  bottom: 42%;
  background-image: url(../assets/password.png);
  background-repeat: no-repeat;
  background-size: cover;
} */
.submit {
  display: flex;
  justify-content: center;
  align-items: center;
  color: #f4f4f5;
  font-size: 16px;
  margin-top: 52px;
  margin-left: 30px;
  width: 295px;
  height: 37px;
  background: #409eff;
  border-radius: 19px;
  opacity: 1;
  border: #409eff;
}
.text7 {
  top: 88%;
  left: 82%;
  position: absolute;
  width: 196px;
  height: 45px;
  font-size: 35px;
  font-family: MicrosoftYaHeiUI-Bold-, MicrosoftYaHeiUI-Bold;
  font-weight: normal;
  color: #d7e8fa;
  opacity: 0.3;
}
.text8 {
  top: 92%;
  left: 82%;
  position: absolute;
  width: 110px;
  height: 24px;
  font-size: 20px;
  font-family: MicrosoftYaHeiUI-Bold-, MicrosoftYaHeiUI-Bold;
  font-weight: normal;
  color: #409eff;
  white-space: nowrap;
}
</style>
